#define _CRT_SECURE_NO_WARNINGS 
#include <stdio.h>
struct stu
{
	char name[9];
	int ch;
	int math;
	int en;
	int sum;
}q[1001];
int main()
{
	int n;
	int t=0;
	int max = 0;
	scanf("%d", &n);
	for (int i = 0; i < n; i++)
	{
		scanf("%s", q[i].name);
		scanf("%d%d%d", &q[i].ch, &q[i].math, &q[i].en);
		q[i].sum = q[i].ch + q[i].math + q[i].en;
		if (i == 0)
			max = q[i].sum;
		if (max < q[i].sum)
		{
			max = q[i].sum;
			t = i;
		}
	}
	printf("%s %d %d %d", q[t].name, q[t].ch, q[t].math, q[t].en);
	return 0;
}
